using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using IGlobalist.Cms.Bll;
using IGlobalist.Cms.Model;
using IGlobalist.Cms.Common;

namespace IGlobalist.Cms.Admin
{
    public partial class ClassMenagement : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {

                ucActionBar.ObjectTypeCurrent = CmsObjectType.Page;
                ucAtionBarBottom.ObjectTypeCurrent = CmsObjectType.Page;
            }
            ucActionBar.NewButtonClick += ucClassAddEdit.DoNewClass;
            ucActionBar.NewButtonClick += ShowInfo;
            ucActionBar.NewButtonClick += HiddenInfo;

            ucAtionBarBottom.NewButtonClick += ucClassAddEdit.DoNewClass;
            ucAtionBarBottom.NewButtonClick += ShowInfo;
            ucAtionBarBottom.NewButtonClick += HiddenInfo;

            ucAtionBarBottom.NewButtonClick += ucActionBar.DoEditClassClick;
            ucActionBar.NewButtonClick += ucAtionBarBottom.DoEditClassClick;

            ucActionBar.SaveButtonClick += ucClassAddEdit.DoSaveClass;
            ucAtionBarBottom.SaveButtonClick += ucClassAddEdit.DoSaveClass;
            ucAtionBarBottom.SaveButtonClick += ucClassTree.BindRefesh;
            ucActionBar.SaveButtonClick += ucClassTree.BindRefesh;
          

            ucAtionBarBottom.SaveButtonClick += ucAtionBarBottom.DoEditClassClick;
            ucAtionBarBottom.SaveButtonClick += ucActionBar.DoEditClassClick;
            ucActionBar.SaveButtonClick += ucActionBar.DoEditClassClick;
            ucActionBar.SaveButtonClick += ucAtionBarBottom.DoEditClassClick;


            ucClassTree.SelectedClassChanged += ucClassAddEdit.DoBindData;
            ucClassTree.SelectedClassChanged += ucActionBar.DoListEditClick;
            ucClassTree.SelectedClassChanged += ucAtionBarBottom.DoListEditClick;
            ucClassTree.SelectedClassChanged += ShowInfo;
            ucClassTree.SelectedClassChanged += HiddenInfo;
            ucActionBar.DeleteButtonClick += ucClassTree.DoDeleteClass;
            ucActionBar.DeleteButtonClick += ucClassAddEdit.DoNewClass;
            ucActionBar.DeleteButtonClick += ucActionBar.DoEditClassClick;
            ucActionBar.DeleteButtonClick += ucAtionBarBottom.DoEditClassClick;


            ucAtionBarBottom.DeleteButtonClick += ucClassTree.DoDeleteClass;
            ucAtionBarBottom.DeleteButtonClick += ucClassAddEdit.DoNewClass;
            ucAtionBarBottom.DeleteButtonClick += ucAtionBarBottom.DoEditClassClick;
            ucAtionBarBottom.DeleteButtonClick += ucActionBar.DoEditClassClick;

            ucActionBar.CopyButtonClick += ucClassAddEdit.DoCopyClass;
          
        }

        public void HiddenInfo(object sender, EventArgs e)
        {
            pnlInfo.Visible = false;
        }

        public void ShowInfo(object sender, EventArgs e)
        {
            ucClassAddEdit.Visible = true;
        }
    }
}
